public class arrToString {
    public static void main(String[] args) {
        char[] ch = {'1','2','3',48,65,97};
        String s = arrtoString(ch);
        System.out.println(s);
    }
    public static String arrtoString(char[] arr) {
        if(arr == null) {
            return " ";
        }
        if(arr.length == 0) {
            return "[]";
        }
        String result = "[";
        for (int i = 0; i < arr.length; i++) {
            if(i == arr.length - 1) {
                result = result + arr[i];
            }else {
                result = result + arr[i] + ", ";
            }
        }
        result = result + "]";
        return result;
    }
}
